Filtering larvae files that have been trimmed for adapters for context and coverage

M1

In [11]:
#Output for methratio file
methratio="/Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_methratio_files/"

#Location of filtered files
filtered="/Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/"
In [3]:
#command for only obtaining the context '__CG_'
!grep "[A-Z][A-Z]CG[A-Z]" <{methratio}methratio_out_M1.txt> {filtered}methratio_out_CG_M1.txt
In [6]:
#obtaining a filtered file with at least 5x coverage
!awk '{if ($8 >= 5) print $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12}' </Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG_M1.txt> /Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG5x_M1.txt
In [7]:
!tr ' ' "\t" </Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG5x_M1.txt> /Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG5x_M1_tab.txt

M3

In [12]:
#command for only obtaining the context '__CG_'
!grep "[A-Z][A-Z]CG[A-Z]" <{methratio}methratio_out_M3.txt> {filtered}methratio_out_CG_M3.txt
In [13]:
#obtaining a filtered file with at least 5x coverage
!awk '{if ($8 >= 5) print $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12}' </Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG_M3.txt> /Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG5x_M3.txt
In [14]:
!tr ' ' "\t" </Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG5x_M3.txt> /Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG5x_M3_tab.txt

T1D3

In [15]:
#command for only obtaining the context '__CG_'
!grep "[A-Z][A-Z]CG[A-Z]" <{methratio}methratio_out_T1D3.txt> {filtered}methratio_out_CG_T1D3.txt
In [16]:
#obtaining a filtered file with at least 5x coverage
!awk '{if ($8 >= 5) print $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12}' </Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG_T1D3.txt> /Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG5x_T1D3.txt
In [17]:
!tr ' ' "\t" </Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG5x_T1D3.txt> /Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG5x_T1D3_tab.txt

T1D5

In [18]:
#command for only obtaining the context '__CG_'
!grep "[A-Z][A-Z]CG[A-Z]" <{methratio}methratio_out_T1D5.txt> {filtered}methratio_out_CG_T1D5.txt
In [19]:
#obtaining a filtered file with at least 5x coverage
!awk '{if ($8 >= 5) print $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12}' </Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG_T1D5.txt> /Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG5x_T1D5.txt
In [20]:
!tr ' ' "\t" </Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG5x_T1D5.txt> /Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG5x_T1D5_tab.txt

T3D3

In [21]:
#command for only obtaining the context '__CG_'
!grep "[A-Z][A-Z]CG[A-Z]" <{methratio}methratio_out_T3D3.txt> {filtered}methratio_out_CG_T3D3.txt
In [22]:
#obtaining a filtered file with at least 5x coverage
!awk '{if ($8 >= 5) print $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12}' </Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG_T3D3.txt> /Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG5x_T3D3.txt
In [23]:
!tr ' ' "\t" </Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG5x_T3D3.txt> /Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG5x_T3D3_tab.txt

T3D5

In [24]:
#command for only obtaining the context '__CG_'
!grep "[A-Z][A-Z]CG[A-Z]" <{methratio}methratio_out_T3D5.txt> {filtered}methratio_out_CG_T3D5.txt
In [25]:
#obtaining a filtered file with at least 5x coverage
!awk '{if ($8 >= 5) print $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12}' </Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG_T3D5.txt> /Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG5x_T3D5.txt
In [26]:
!tr ' ' "\t" </Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG5x_T3D5.txt> /Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG5x_T3D5_tab.txt
In [1]:
#NOTEBOOK NAME
nb='Filtering_Larvae_AdapterTrimmed'

#NOTEBOOK LOCATION
nbloc='/Users/claireolson/Dropbox/Lab\ \(1\)/IPython_nbs/Claire/'



#TIMESTAMP
date=!date +%m%d_%H%M
#LOCATION OF POST DIRECTORY
post='/Volumes/web/Mollusk/iPython_Posts/'
In [2]:
cd {post}
/Volumes/web/Mollusk/iPython_Posts

In [*]:
!ipython nbconvert {nbloc}{nb} --to html --template full --output {nb}{date}
In []: